UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q4RQhTr2rGAXLtHLOT3liyxSWY3tCKZsSs5fEcHkQg0='
WHERE
key_id = 'eef426c8bc8909216946416849da71dc7012a38967174f6ba62e443d17859cd7'
AND (
token = 'Q4RQhTr2rGAXLtHLOT3liyxSWY3tCKZsSs5fEcHkQg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)