UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dyBRdxzvs5YaW8LesM4MZULD2phmS3mR2QsSmCy6hyY='
WHERE
key_id = '1b6125ce6f989b2eb5e62a6c49019db0f20cd40397d3533da8da3706403d846b'
AND (
token = 'dyBRdxzvs5YaW8LesM4MZULD2phmS3mR2QsSmCy6hyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)