UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3sIFO2dygohBesESA52H/O0GPuuHwNjAyLzsYaeC/8M='
WHERE
key_id = 'bdc8c090b3ff9abeba9beba2463a9436f46830d8349f02815443ae7dd5acb735'
AND (
token = '3sIFO2dygohBesESA52H/O0GPuuHwNjAyLzsYaeC/8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)