UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M8mBZHzWWmoRA/EwjYrbLp74zezh9opzMR2Z+Q31Va0='
WHERE
key_id = 'aec37daad18faf9cec55d21dfd9f105d7e0268f615eb5a64a3cf693ce572cb99'
AND (
token = 'M8mBZHzWWmoRA/EwjYrbLp74zezh9opzMR2Z+Q31Va0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)