UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/J1MoKVHRZ3p5/emSSaG0TiIDEqYhO388H4KxtEOL70='
WHERE
key_id = 'c8d5f6bf94fc701354d3cada10018c0e94a88fd82a313eed7c824d16fbad3ee7'
AND (
token = '/J1MoKVHRZ3p5/emSSaG0TiIDEqYhO388H4KxtEOL70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)