UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v7Nh4V0BfOCVBoSXQR43SVIdJpajDJLK7jL48IzY1KI=' 
WHERE 
  key_id = '63e07c3e45fe172da013dc590a2264127cf778a20b8bfbe3e3608477c6242f58' 
  AND (
    token = 'v7Nh4V0BfOCVBoSXQR43SVIdJpajDJLK7jL48IzY1KI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025