UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'asXF55HlA04QLS+acoKCmICqPDQGacUoWF9N98gZ/m4='
WHERE
key_id = 'c67ed955d90b229391cc57a0191db993c0a271875364b0b0365d5256951b2f1d'
AND (
token = 'asXF55HlA04QLS+acoKCmICqPDQGacUoWF9N98gZ/m4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)