UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3qpP0edDcCboQjS17aKOqm7AyOTzCFfrP4bi2S0xzjQ='
WHERE
key_id = '62f9895c57e810f47e9fa8bcf01316b2981a2bab6b9c25df9d7aec9dff277a69'
AND (
token = '3qpP0edDcCboQjS17aKOqm7AyOTzCFfrP4bi2S0xzjQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)