UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QIHsRZAGupOJncUk2p2Go94nzUgOzDIdGLn06n2S6oA=' 
WHERE 
  key_id = 'ebe75f5c3bdeb8884c7e0e16f0beaaa4f2864a16cd4a4417b692514c55e58a34' 
  AND (
    token = 'QIHsRZAGupOJncUk2p2Go94nzUgOzDIdGLn06n2S6oA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043