UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B1P+/jywN/Es/0Rb//MTeMRav+q5GCjIWoW9OYJk6Q8='
WHERE
key_id = '26e5fabf535619a860d1f0d7102b3dcc1c53cb2e8a52985614f569822ec17c18'
AND (
token = 'B1P+/jywN/Es/0Rb//MTeMRav+q5GCjIWoW9OYJk6Q8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)