UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Q2wYpLQQaTcukDOce/LTgshakuavGSqROeZwpqP2p8='
WHERE
key_id = 'c10e7f08540b65f126f25a78988507af20e6883022ed17bd5ed06c465a04b133'
AND (
token = '2Q2wYpLQQaTcukDOce/LTgshakuavGSqROeZwpqP2p8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)