UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y3NDgrDhqaGD2Y2SrioeJVymbyEmA3RVwl+Et2Ceheo=' 
WHERE 
  key_id = 'a4d9a9ac210661457869ea306af56f2303fe50f04502ead3fb4db63ed8dd6856' 
  AND (
    token = 'Y3NDgrDhqaGD2Y2SrioeJVymbyEmA3RVwl+Et2Ceheo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028