UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yzQNtTtWOtWRjQ/PPQpBHGcCudhDyOIPR6F2p5aYnvE='
WHERE
key_id = '6016b5ecbf30ba39e1b7d15783bf90702da82cca1dc60e8212b2561fb95ee4ec'
AND (
token = 'yzQNtTtWOtWRjQ/PPQpBHGcCudhDyOIPR6F2p5aYnvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)