UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yT1gpI2YU+fkEilZmKdwpqczUBQsP5ikYR/ssAiBUZM='
WHERE
key_id = 'cbdbbc6117d368ae37ed1edd3b036cc947d9fe953cebc21a6915ecfda923dbae'
AND (
token = 'yT1gpI2YU+fkEilZmKdwpqczUBQsP5ikYR/ssAiBUZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)