UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sagkv2jHKnuiHYI2ayzu8YSBQlJd3i5RM8focnBI3MI='
WHERE
key_id = '75eaca1dd2927acb3da99d494b4d1ff1ce03494dde3b120afca2dbd72d849e6a'
AND (
token = 'sagkv2jHKnuiHYI2ayzu8YSBQlJd3i5RM8focnBI3MI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)