UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7LDLAkwX+pd6mH/8YJGMGjrkmPuReLnrcHDOmVpaRfc='
WHERE
key_id = '11f9ddd8bd80ec497a2b0fe736c1a5f60629822f457cbfb569fa800704ab862b'
AND (
token = '7LDLAkwX+pd6mH/8YJGMGjrkmPuReLnrcHDOmVpaRfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)