UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T/z6EeEqB+WdCnaQvKWJkZVGNVYPeHY1U0/wx/264Xo=' 
WHERE 
  key_id = '5fd574cf8b9c45f7951c89f8666d644b5447b434a314865e4d3f535f5555dd62' 
  AND (
    token = 'T/z6EeEqB+WdCnaQvKWJkZVGNVYPeHY1U0/wx/264Xo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016