UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YHU6qdP6lZGMBjXcVBWSYrL9QRICXu8YUFbjCpMZ7so='
WHERE
key_id = '1cb53a54b0aeec43e94e9c0855641e34341af23aaa368c69edafb293a08c2ca7'
AND (
token = 'YHU6qdP6lZGMBjXcVBWSYrL9QRICXu8YUFbjCpMZ7so='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)