UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JRyH/fc58O684R+5IV/3hMhgL8FGSm0UH/UsE0/fzYY=' 
WHERE 
  key_id = 'e5e37f34706727d4bebf50f9f91b5c926fd55b9cc585840d561995791f01ca22' 
  AND (
    token = 'JRyH/fc58O684R+5IV/3hMhgL8FGSm0UH/UsE0/fzYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034