UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OqRfArl1xtVIfEIAgKrU1X/NRF/N5vTXq1KkGOfAI2M='
WHERE
key_id = 'e44704322141c9d74db795cfbe94b10f8a6c234c59445f48464d0c2f60cc1a65'
AND (
token = 'OqRfArl1xtVIfEIAgKrU1X/NRF/N5vTXq1KkGOfAI2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)