UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ZF5XcHQ9iDRvectbUJn4UpchCa/pjpQPbdC69qS6m8='
WHERE
key_id = 'fdd702417158aba636e0422695c6a33c8efa89feb92beaf7edb06a967d74cdf8'
AND (
token = '2ZF5XcHQ9iDRvectbUJn4UpchCa/pjpQPbdC69qS6m8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)