UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'swgJDXJgmyyBp5feK2Mlh0haAWdbfMLDz5W+sRrAIXQ='
WHERE
key_id = '7834bef452938e4d31a22b6d897a169bf3bb99b1339bb6303c604650cebb3a26'
AND (
token = 'swgJDXJgmyyBp5feK2Mlh0haAWdbfMLDz5W+sRrAIXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)