UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FuXSd1EimldFqkAks/qHo6xMSUJ8JN/bpoZl9bL7NW4=' 
WHERE 
  key_id = '2a514944bddb9de991054625f1fffd44f26bef5e494daf9afd3282b159a2dc1e' 
  AND (
    token = 'FuXSd1EimldFqkAks/qHo6xMSUJ8JN/bpoZl9bL7NW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025