UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/Ap2QExZiM8cTxbdqITYcMzhwzCKeQkT5SKtl6D9Lg='
WHERE
key_id = '33ce6cefcd3331afb2bd5dbd69776894826f2c059bd100a5df708f83cc94078f'
AND (
token = 'a/Ap2QExZiM8cTxbdqITYcMzhwzCKeQkT5SKtl6D9Lg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)