UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r69q0Y83T+gY2ld8jJ8UJhh7DNuoPdWgpOPWGKtrN3M='
WHERE
key_id = '3e5fb3d221461cfe793693d0ec6646bc15a74a1835be3ad05abc83f35621f29e'
AND (
token = 'r69q0Y83T+gY2ld8jJ8UJhh7DNuoPdWgpOPWGKtrN3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)