UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ypVWgMz49uW4nctcuOBcrulsLn262QoqUIggNPHD4oA='
WHERE
key_id = '9d499c641c2399c0bdb72aaaa5df7cec7028a82ad302d54e7aba865c094a4279'
AND (
token = 'ypVWgMz49uW4nctcuOBcrulsLn262QoqUIggNPHD4oA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)