UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd24ngTe6fpGg9GU9bqkXU88gwN7XBUiFc/S59z8ESf4=' 
WHERE 
  key_id = '4d129831f2e9049798ad39fefd22b5cff2c9fd9b17d6ceeedf22c14c64d352cd' 
  AND (
    token = 'd24ngTe6fpGg9GU9bqkXU88gwN7XBUiFc/S59z8ESf4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040