UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LyfkWYNX4N/xPT/1RGWAWtA4oBBWfKGGjBJsQ8uXhAQ=' 
WHERE 
  key_id = 'c73985ab8022c9b77bc3d711262e3c60737fed1d24d059ddf011c72ec3e1fe9b' 
  AND (
    token = 'LyfkWYNX4N/xPT/1RGWAWtA4oBBWfKGGjBJsQ8uXhAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039