UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IGWgY2ir0Jw72tQu39F7Cwc+ouqzfICeeJ6OQKTaU9c=' 
WHERE 
  key_id = '021acf2858ffd24a3c545592b6fa905ddf0d6392d244885877a477fa1fcbfab8' 
  AND (
    token = 'IGWgY2ir0Jw72tQu39F7Cwc+ouqzfICeeJ6OQKTaU9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034