UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aAI/xX7ghebjObcq35Jt5268pGVS5rUXBy5G9LBGSjY=' 
WHERE 
  key_id = '899b1295c058a0457a5bedc86b11f6281a80058039766dc70f33aaac45016ac2' 
  AND (
    token = 'aAI/xX7ghebjObcq35Jt5268pGVS5rUXBy5G9LBGSjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031