UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oxBVnYVOt5HueGa7XFzh0Idh4hTdoGcSjnrlwxVasDI=' 
WHERE 
  key_id = '964d3fced6082f7f7ab23af2a5abaf2b0f458c750d3c6b3aa0c8d5557bda170c' 
  AND (
    token = 'oxBVnYVOt5HueGa7XFzh0Idh4hTdoGcSjnrlwxVasDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028