UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N1Gwlv4QIDEjUuzC6SHMPkOXDqBmpSgfZVYUYqVjhwo='
WHERE
key_id = '80b3c2bfaf46f097275d2f4eea2a62f6b6ab71e3aec4368c9141f64770fe5fca'
AND (
token = 'N1Gwlv4QIDEjUuzC6SHMPkOXDqBmpSgfZVYUYqVjhwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)