UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jjlZtGg1VOkDZTNs70ug+/Lo0fxZUCLosXCbkQZAi0Y='
WHERE
key_id = 'f5761ec81ed26627fc679115b3c788398f5142c1ad0c6f46d1d3ce443eb28d82'
AND (
token = 'jjlZtGg1VOkDZTNs70ug+/Lo0fxZUCLosXCbkQZAi0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)