UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fHe//IipLZHb+XxGItxVs5ufgjH31hxgUTUEcT2Q7QI=' 
WHERE 
  key_id = '5da9c1875fdb4d589b52f25f9ff83d4b9f39bbdc6bd274c56927c2b45b9e6f3c' 
  AND (
    token = 'fHe//IipLZHb+XxGItxVs5ufgjH31hxgUTUEcT2Q7QI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037