UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k5BJY/UBVanI6UHCBEenmxsSTuBDIBVAyYObthke/94='
WHERE
key_id = 'c9ee22f25e52531a2597ee62815ddce581b52902c10d3732ef294443acfbe64b'
AND (
token = 'k5BJY/UBVanI6UHCBEenmxsSTuBDIBVAyYObthke/94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)